import path from "path";
import { defineConfig } from "vite";
import uni from "@dcloudio/vite-plugin-uni";
import AutoImport from "unplugin-auto-import/vite";
import styleImport, { VantResolve } from "vite-plugin-style-import";

// https://vitejs.dev/config/
export default defineConfig({
  resolve: {
    alias: {
      "@/": `${path.resolve(__dirname, "src")}/`,
    },
  },
  server: {
    port: 8081,
    open: true
  },
  plugins: [
    uni(),
    AutoImport({ imports: ["vue"], dts: "./auto-imports.d.ts" }),
    styleImport({
      resolves: [VantResolve()],
    }),
  ],
});
